home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / s_to_z / tmmplot / tmmplot.txt < prev   
Text File  |  1996-09-15  |  12KB  |  272 lines

  1. TMMPlot
  2.  
  3. This Delphi-Component allows the user to easily display a HPGL/2-plot on a form,
  4. paintbox or printer canvas. Free definable pencolors.
  5.  
  6. The functionality is comparable to the mediaplayer. The component has no own
  7. canvas but needs a canvas to display the graphics. Pencolors and penstyles are
  8. set automatically, other canvasoptions have to be preset.
  9.  
  10. Advanced Version includes zoom & pan and zoom-to-printer.
  11. Professional Version includes print-2-scale and send-to-plotter.
  12.  
  13. LIST OF FILES.
  14.  
  15.         File                    Description
  16.  
  17.     TMMPlot.TXT      Software Documentation (this file).
  18.      TMMPlot.REG      Registration form.
  19.      TMMPlot.DCU      Component object code.
  20.      TMMPlot.DCR      Component resource file.
  21.      MMPLOT.DLL       DLL required from TMMPLOT and MMPlot.EXE
  22.         MMPlot.ini       You can determine in which page of the gallery TMMPlot
  23.                          is to be installed.
  24.   (It is recommended to copy MMPlot.DLL and MMPlot.ini into your WINDOWS or
  25.    SYSTEM directory)
  26.      DEMO.DPR         Demo project file
  27.      DEMO.RES         Demo project resource file
  28.      MAIN.PAS         Demo unit
  29.      MAIN.DFM         Demo form
  30.      SAMPLE.PLT       Demo-Plotfile.
  31. eventually:
  32.         MMPlot.EXE       Viewer based on TMMPLOT 
  33.      MMPlot.TXT       Software Documentation (Viewer).
  34.  
  35. PROPERTIES
  36.  
  37. -Published-
  38.  
  39. Active: boolean      Active=true opens a file and projection is enabled.
  40.  
  41. Display: tpaintbox   The projector screen can be selected. If no paintbox is
  42.                      available/selected, the parent form will be the display.
  43.  
  44. DitherOfs:integer    Correction offset to fix dithering density  
  45.  
  46. PenWidthfactor:integer   Correction factor to fix penwidths
  47.                      Default = 4 --> PW0.25 * 4 = 1 pixel
  48.  
  49. GraphDir, GraphName: string    Plotdirectory and HPGL-Sourcefile
  50.  
  51. IsOpen:boolean       Plotfile was opened 
  52. IsZoomed:boolean     Zoom active
  53. IsPanned:boolean     Pan active
  54.  
  55. MapMode: TMapMode    Show Plot in isotropic/anisotropic mode
  56.  
  57. Name: TComponentname
  58.  
  59. Options: TGraphOptions Various graphic options can be set as there are:
  60. [**]                             goPrint       : Output to Printer
  61. [**]                             goOrigScale   : Print in original scale
  62. [**]                             goGrid        : Display pageframes on screen.
  63. [**]                             goPageNums    : Print Pagenumbers on the different sheets.
  64. [**]                             goBlackprint  : Print using black pen for all colors.
  65.  
  66. Startpage, Endpage, PrintCopies: word
  67. [**]                             See TReport....
  68.  
  69. Painttiming: TPaintTiming
  70.                                  This depicts when the OnPaint-eventhandling will be
  71.                                  executed in relation to Display.OnPaint.
  72.                                  Possible values are:
  73.                                  ptBefore : Before Display.OnPaint
  74.                                  ptReplace: Instead of Display.OnPaint
  75.                                  ptAfter  : After Display.OnPaint
  76.  
  77. Pen1...Pen8: tcolor   colors for plotter-pens no 1 to 8
  78.  
  79. Pencolor[Index:Integer]:tColor    up to 255 pencolors can be set
  80.  
  81. BackGnd:Tcolor       Backgroundcolor used for dithered fill
  82.  
  83. Port: TMMComm        You can assign a communication port of the TMMComm or
  84.                      derived classes. If no Port is assigned, TMMPlot will create
  85.                      its own, using default parameter,if necessary.
  86.  
  87. Title:string         Title displayed in printmanager
  88.  
  89.  
  90. -Public-
  91.  
  92. Version : string     RevisionCode  ( 16.02e = 16bit-revision 2-english )
  93. Error   : string     Display Errortext and clear it (if any)
  94. Filename: string     HPGL-file with complete path
  95. Blackprint  : boolean   All printer output will use black pen & brush
  96. DirecttoPort: boolean   if TRUE : Send directly to local port specified by portname (WriteComm),
  97.                         if FALSE: File will be copied to destination file or port.
  98. Destination : string    filename to copy the file to, may also be a port name (not under WinNT)
  99.  
  100. PortName    : string    For Example: "COM3:"
  101. BaudRate    : TBaudRate = (br110, br300, br600, br1200, br2400, br4800, br9600, br14400,
  102.                            br19200, br38400, br56000, br128000, br256000);
  103. ParityBits  : TParityBits = (pbNone, pbOdd, pbEven, pbMark, pbSpace);
  104. DataBits    : TDataBits = (dbFour, dbFive, dbSix, dbSeven, dbEight);
  105. StopBits    : TStopBits = (sbOne, sbOnePointFive, sbTwo);
  106. FlowControl : TFlowControl = (fcNone, fcRTSCTS, fcXONXOFF);
  107.  
  108.  
  109. METHODS
  110.  
  111. constructor Create(AOwner: TComponent);
  112. destructor  Free;
  113. procedure   Close;                     Deactivate, Close Plotfile
  114. procedure  ZoomAll;                    Reset Zoom, Refresh
  115. procedure  SetZoom( r : trect );       Zoom-In
  116. procedure  Pan    ( r : trect );       Pan
  117. function   SaveFileAs(newname:tfilename):boolean;     Save Plotdata in binary file
  118.                                                       Returns TRUE if ERROR !!!
  119. procedure Hardcopy;                   Hardcopy in actual mode
  120. function  Send:boolean;               Send or copy to plotter/printer port or file
  121. procedure SetDefPal_255;              Set System default palette colors 
  122. procedure SetACADPal_9;                  Set Pen 1..9 Autocad colors 
  123. procedure SetStdPal_8;                
  124. function  Size( Var mmx,mmy   : longint;
  125.                 Var PageCount : word
  126.                ):boolean;    { true = ERROR }
  127.            Returns the Dimensions of the Plot and the amount of printer pages
  128.            it would take to print the whole thing in original scale.
  129. function  Info( p : pPlotInfo ):boolean;
  130.                 Provides more details concerning the plot in the following structure:
  131.  
  132.   plotInfo = ^tPlotInfo;              { pointer on struct }
  133.   type tPlotInfo = record
  134.      mmx, mmy,                        { Dim [mm] }
  135.      plxmax,                          { Max x [plotunit] }
  136.      plymax,                          { Max y [plotunit] }
  137.      plxmin,                          { Min x [plotunit] }
  138.      plymin : longint;                { Min y [plotunit] }
  139.      penbuf : array[0..255] of byte;  { used pens (penbuf[0]=highest penNr) }
  140.                                       { penbuff[i] > 0 = pen i used }
  141.      pages  : word;                   { required page# on actual printer }
  142.   end;
  143.  
  144. procedure GetPortsAvail( SerialOnly: boolean; List: TStrings );
  145.      Fills a string list with the names of the currently available ports
  146.  
  147. procedure orientate(r:real);          Rotate: r=0░/90░/180░/270░  
  148.  
  149. EVENTS
  150.     OnActivate
  151.     OnDeactivate
  152.     OnFileOpen       File will be opened on first activation or on a call
  153.                      to .Size or .Info method.
  154.     OnPaint          Paint event, hooked into display's paintevent
  155.                      See property painttiming.
  156.  
  157.  
  158. Installing TMMPlot
  159.  
  160. To install this VCL, copy both MMPlot.DCU and MMPlot.DCR to the
  161. directory where you have your other shareware controls.  Then,
  162. from Delphi's main menu, select Options|Install Components.  In the
  163. dialog, click on the Add... button, then Browse... and change to the
  164. drive/directory where you stored the above two files.  Select
  165. MMPlot.DCU and click OK, then OK again.
  166. Copy MMPLOT.DLL into Your outputdirectory for your EXE or DLL or to
  167. Your Windows or System directory (recommended for Designers).
  168. The component needs MMPLOT.DLL to interpret HPGL-files.  The DLL
  169. is dynamically loaded and may not be needed if the plot is "precompiled".
  170. See section below for more information.
  171. You can copy MMPlot.INI into your Windows directory to Determine into
  172. which gallery page the component(s) should be installed.
  173.  
  174. Using TMMPlot
  175.  
  176. To use this control, simply place it on your form, and edit the
  177. Graphname, Options, Pens and Display properties.
  178. If you have the pro version and place a TMMComm or derived component 
  179. on the Form, you can select is as the port property for a TMMPlot.
  180.  
  181. You can use TMMPLOT without MMPLOT.DLL in certain circumstances. The DLL is
  182. loaded dynamically when the first HPGLfile is opened.
  183. Raw graphic data is saved in a temporary binary file (Property FFil